from loguru import logger
from selenium.webdriver.common.by import By

import datetime

from commonDemo.common_element import BaseAction


class talentPage(BaseAction):
    # 定位元素
    talentText = By.XPATH, "//span[text()='主泵1A']"
    indexModel = By.XPATH, "//div[@class='ant-row index_modelName__q034c']"
    tabs = By.ID, "rc-tabs-0-tab-statistics_tabs1"

    def talentClick(self):
        self.click(self.talentText)
        logger.info("点击主泵1A")

    def indexmo(self):
        self.actions(self.indexModel)
        logger.info("鼠标悬停")

    def tabsClick(self):
        self.click(self.tabs)

    #
    def indexModelText(self):
        """
        获取索引模型的文本内容

        该方法从索引模型中提取文本信息，并将其返回。

       返回:
           str: 索引模型中的文本内容
       """
        return self.get_text(self.indexModel)
